package com.tk.controller;

import com.tk.bean.Car;
import com.tk.bean.Person;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class Hello {

    @Autowired
    private Car car;

    @Autowired
    Person person;

    @RequestMapping("/car")
    public Car car() {
        return car;
    }

    @RequestMapping("/person")
    public Person person() {
        return person;
    }

    @RequestMapping("/hello")
    public String hello(@RequestParam("name") String name) {
        log.info("请求进来了");
        return "hello world：" + name;
    }
}
